package com.mark.mall.admin.platform.config;

import liquibase.integration.spring.SpringLiquibase;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @ClassName LiquiBaseConfig
 * @Author lcn
 * @Date 2022/7/14 19:47
 */
@Configuration
public class LiquiBaseConfig {

    @Bean
    public SpringLiquibase liquibase(DataSource dataSource) {
        SpringLiquibase liquibase = new SpringLiquibase();
        liquibase.setDataSource(dataSource);
        // xml 入口配置文件地址
        liquibase.setChangeLog("classpath:db/master.xml");
        liquibase.setShouldRun(true);
        return liquibase;
    }
}
